#include "GameState.h"
#include "../Common/Common.h"
#include "../DungeonGenerator/NormalDungeonGenerator.h"
#include "DxLib.h"

// ------------------------------ //

GameState::GameState(GameStateType::States type)
	: IGameState( type )
	, m_map( std::make_shared<Map>(50,40) )
	, m_actionManager( m_map )
{
	m_generator = std::make_shared<NormalDungeonGenerator>(m_map);
	m_map = m_generator->Generate();
}

// ------------------------------ //

GameState::~GameState(void)
{
	m_charaManager.Clear();
}

// ------------------------------ //

void GameState::OnEnter( GameStateType::States previousState )
{
	UNUSED_VARIABLE( previousState );
}

// ------------------------------ //

void GameState::OnExit( GameStateType::States nextState )
{
	UNUSED_VARIABLE( nextState );
}

// ------------------------------ //

void GameState::Update( float delta )
{
	m_charaManager.Update( delta );
	m_actionManager.Update( delta );
}

// ------------------------------ //

void GameState::Draw( float delta )
{
	m_map->Draw();
	m_charaManager.Draw();
	m_actionManager.Draw();
}




